#!/usr/bin/env ruby
# - project_name
# - build_type
# - arch
# - pipeline_id
# eulermaker-build-project


require 'json'
require "#{ENV['LKP_SRC']}/lib/init_ccb.rb"
clone_ccb

require "#{ENV['LKP_SRC']}/lib/eulermaker_build.rb"

def main
  write_cli_config
  build_id = start_build_project
  loop_wait_build_project_finished(build_id)
  if ENV['pipeline_id']
    task_id = start_build_image
    loop_wait_build_image_finished(task_id)
  end
end

main
